package com.module;

import com.module.api.Message;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

import java.util.ArrayList;

public class Application {
    public static void main(String[] args) throws Exception {
        // 创建动态客户端
        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
        Client client = dcf
                .createClient("http://localhost:8080/services/PublishService?wsdl");
        // getUser 为接口中定义的方法名称 张三为传递的参数 返回一个Object数组
        Object[] objects = client.invoke("helloService", "张三");
        Object[] objects1 =  client.invoke("getAllBean");

        System.out.println(objects[0]);
        System.out.println(objects1[0]);
    }
}
